using System;
using System.Data;

public class jsh_property
{
    public Int32 id { get; set; }
    public Int32 Incardcounts { get; set; }
    public Int32 Outcardcounts { get; set; }
    public Int32 Initialcardcounts { get; set; }
    public Int32 Currentcardcounts { get; set; }
    public Decimal Inmoney { get; set; }
    public Decimal Outmoney { get; set; }
    public Decimal Initialmoney { get; set; }
    public Decimal Currentmoney { get; set; }
    public Decimal Inreceiptmoney { get; set; }
    public Decimal Outreceiptmoney { get; set; }
    public Decimal Initialreceiptmoney { get; set; }
    public Decimal Currentreceiptmoney { get; set; }
    public Int32 Fixcards { get; set; }
    public Decimal Fixmoney { get; set; }
    public string Operateaddress { get; set; }
    public Int64 Operateaddressid { get; set; }
    public string Operater { get; set; }
    public Int64 Operaterid { get; set; }
    public DateTime Operatetime { get; set; }
    public string Operatepsamid { get; set; }
    public string Describe { get; set; }

    private string InsertSql = "insert into jsh_property([id],[InCardCounts],[OutCardCounts],[InitialCardCounts],[CurrentCardCounts],[InMoney],[OutMoney],[InitialMoney],[CurrentMoney],[InReceiptMoney],[OutReceiptMoney],[InitialReceiptMoney],[CurrentReceiptMoney],[FixCards],[FixMoney],[OperateAddress],[OperateAddressid],[Operater],[Operaterid],[Operatetime],[OperatePsamid],[Describe]) values(@id,@InCardCounts,@OutCardCounts,@InitialCardCounts,@CurrentCardCounts,@InMoney,@OutMoney,@InitialMoney,@CurrentMoney,@InReceiptMoney,@OutReceiptMoney,@InitialReceiptMoney,@CurrentReceiptMoney,@FixCards,@FixMoney,@OperateAddress,@OperateAddressid,@Operater,@Operaterid,@Operatetime,@OperatePsamid,@Describe)";
    private string UpdateSql = "UPDATE jsh_property SET [id]=@id,[InCardCounts]=@InCardCounts,[OutCardCounts]=@OutCardCounts,[InitialCardCounts]=@InitialCardCounts,[CurrentCardCounts]=@CurrentCardCounts,[InMoney]=@InMoney,[OutMoney]=@OutMoney,[InitialMoney]=@InitialMoney,[CurrentMoney]=@CurrentMoney,[InReceiptMoney]=@InReceiptMoney,[OutReceiptMoney]=@OutReceiptMoney,[InitialReceiptMoney]=@InitialReceiptMoney,[CurrentReceiptMoney]=@CurrentReceiptMoney,[FixCards]=@FixCards,[FixMoney]=@FixMoney,[OperateAddress]=@OperateAddress,[OperateAddressid]=@OperateAddressid,[Operater]=@Operater,[Operaterid]=@Operaterid,[Operatetime]=@Operatetime,[OperatePsamid]=@OperatePsamid,[Describe]=@Describe";

    private bool _tranByConstructFlag = false;
    public bool TranByConstructFlag { get { return _tranByConstructFlag; } set { _tranByConstructFlag = value; } }
    public jsh_property(DataRow dataRow)
    {
        if (dataRow != null)
        {
            try
            {
                this.id = dataRow["id"] is DBNull ? 0 : Convert.ToInt32(dataRow["id"]);
                this.Incardcounts = dataRow["InCardCounts"] is DBNull ? 0 : Convert.ToInt32(dataRow["InCardCounts"]);
                this.Outcardcounts = dataRow["OutCardCounts"] is DBNull ? 0 : Convert.ToInt32(dataRow["OutCardCounts"]);
                this.Initialcardcounts = dataRow["InitialCardCounts"] is DBNull ? 0 : Convert.ToInt32(dataRow["InitialCardCounts"]);
                this.Currentcardcounts = dataRow["CurrentCardCounts"] is DBNull ? 0 : Convert.ToInt32(dataRow["CurrentCardCounts"]);
                this.Inmoney = dataRow["InMoney"] is DBNull ? 0 : Convert.ToDecimal(dataRow["InMoney"]);
                this.Outmoney = dataRow["OutMoney"] is DBNull ? 0 : Convert.ToDecimal(dataRow["OutMoney"]);
                this.Initialmoney = dataRow["InitialMoney"] is DBNull ? 0 : Convert.ToDecimal(dataRow["InitialMoney"]);
                this.Currentmoney = dataRow["CurrentMoney"] is DBNull ? 0 : Convert.ToDecimal(dataRow["CurrentMoney"]);
                this.Inreceiptmoney = dataRow["InReceiptMoney"] is DBNull ? 0 : Convert.ToDecimal(dataRow["InReceiptMoney"]);
                this.Outreceiptmoney = dataRow["OutReceiptMoney"] is DBNull ? 0 : Convert.ToDecimal(dataRow["OutReceiptMoney"]);
                this.Initialreceiptmoney = dataRow["InitialReceiptMoney"] is DBNull ? 0 : Convert.ToDecimal(dataRow["InitialReceiptMoney"]);
                this.Currentreceiptmoney = dataRow["CurrentReceiptMoney"] is DBNull ? 0 : Convert.ToDecimal(dataRow["CurrentReceiptMoney"]);
                this.Fixcards = dataRow["FixCards"] is DBNull ? 0 : Convert.ToInt32(dataRow["FixCards"]);
                this.Fixmoney = dataRow["FixMoney"] is DBNull ? 0 : Convert.ToDecimal(dataRow["FixMoney"]);
                this.Operateaddress = dataRow["OperateAddress"] is DBNull ? string.Empty : Convert.ToString(dataRow["OperateAddress"]);
                this.Operateaddressid = dataRow["OperateAddressid"] is DBNull ? 0 : Convert.ToInt64(dataRow["OperateAddressid"]);
                this.Operater = dataRow["Operater"] is DBNull ? string.Empty : Convert.ToString(dataRow["Operater"]);
                this.Operaterid = dataRow["Operaterid"] is DBNull ? 0 : Convert.ToInt64(dataRow["Operaterid"]);
                this.Operatetime = dataRow["Operatetime"] is DBNull ? DateTime.MinValue : Convert.ToDateTime(dataRow["Operatetime"]);
                this.Operatepsamid = dataRow["OperatePsamid"] is DBNull ? string.Empty : Convert.ToString(dataRow["OperatePsamid"]);
                this.Describe = dataRow["Describe"] is DBNull ? string.Empty : Convert.ToString(dataRow["Describe"]);
                this.TranByConstructFlag = true;
            }
            catch (Exception) { this.TranByConstructFlag = false; }
        }
    }
    public jsh_property() { }
}
